import http from '@/utils/request'

/**
 * 获取部门树
 */
export const getDepartmentTree = () => {
  return http.get("/admin/department/getDepartmentTree");
};

/**
 * 添加部门
 */
export const addDepartment = (params) => {
  return http.post("/admin/department/insert", params);
};

/**
 * 修改部门
 */
export const updateDepartment = (params) => {
  return http.post("/admin/department/update", params);
};

/**
 * 删除部门
 */
export const deleteDepartment = (id) => {
  return http.delete("/admin/department/delete", { id: id });
};

/**
 * 根据id查询部门
 */
export const getDepartmentById = (id) => {
  return http.get("/admin/department/selectById", { id: id });
};
